package xiao_jin.fantastic_journey.generator;

import com.klikli_dev.modonomicon.Modonomicon;
import com.klikli_dev.modonomicon.api.datagen.FabricBookProvider;
import com.klikli_dev.modonomicon.api.datagen.LanguageProviderCache;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import xiao_jin.fantastic_journey.FantasticJourney;
import xiao_jin.fantastic_journey.generator.book.GaiaVigilante;
import xiao_jin.fantastic_journey.generator.book.ModZhCnProvider;

public final class FantasticJourneyDataGenerator implements DataGeneratorEntrypoint {
    @Override
    public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
        FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();

        FantasticJourney.LOGGER.info("Fantastic Journey Data Generator is running now!");

        pack.addProvider(ModLootTablesProvider::new);
        pack.addProvider(ModItemTagProvider::new);
        pack.addProvider(ModModelsProvider::new);
        pack.addProvider(ModRecipesProvider::new);
        pack.addProvider(ModBlockTagProvider::new);
        pack.addProvider(ModFluidTagProvider::new);

        FantasticJourney.LOGGER.info("Fantastic Journey Data Generator was finish!");

        var zhCnCache = new LanguageProviderCache("zh_cn");
//        var enUsCache = new LanguageProviderCache("en_us");
        pack.addProvider(FabricBookProvider.of(
                new GaiaVigilante(Modonomicon.MOD_ID, zhCnCache)
//            new GaiaVigilante(FantasticJourney.MOD_ID, enUsCache)
        ));
        pack.addProvider((FabricDataOutput output) -> new ModZhCnProvider(output, zhCnCache));
//        pack.addProvider((FabricDataOutput output) -> new ModEnUsProvider(output, enUsCache));
//        pack.addProvider((FabricDataOutput output) -> new DemoMultiblockProvider(output, FantasticJourney.MOD_ID));
    }
}
